package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.DaoSchoolArticleChild;
import com.sc.nft.entity.dto.DaoSchoolArticleChildPageAdminDTO;
import com.sc.nft.entity.dto.DaoSchoolArticleChildUpdateSortAdminDTO;
import com.sc.nft.entity.dto.DaoSchoolHomeArticleListDTO;
import com.sc.nft.entity.vo.DaoSchoolArticleChildPageAdminVO;
import com.sc.nft.entity.vo.DaoSchoolTopHomeArticlePageVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 文章表与子分类关联表(DaoSchoolArticleChild)表数据库访问层
 *
 * @author makejava
 * @since 2023-03-13 16:21:09
 */
public interface DaoSchoolArticleChildMapper extends BaseMapper<DaoSchoolArticleChild> {

    /**
     * 获取关联的所有文章
     *
     * @param daoSchoolArticleChildPageAdminDTO
     * @return
     */
    Page<DaoSchoolArticleChildPageAdminVO> pageAdmin(Page page, @Param("data") DaoSchoolArticleChildPageAdminDTO daoSchoolArticleChildPageAdminDTO);

    /**
     * 文章关联新增
     *
     * @param info
     * @return
     */
    Integer saveAdmin(@Param("list") List<DaoSchoolArticleChild> info);

    /**
     * 获取置顶的文章
     *
     * @param id
     * @return
     */
    Page<DaoSchoolTopHomeArticlePageVO> getHomeArticleList(Page page, @Param("data") DaoSchoolHomeArticleListDTO dto, @Param("daoId") Long daoId);

    /**
     * 修改排序
     *
     * @param dto
     * @return
     */
    Boolean updateSortById(@Param("data") DaoSchoolArticleChildUpdateSortAdminDTO dto);

}
